<?php

include 'sql.php';
$db_name = $_GET["db_name"];
$table_name = $_REQUEST["table_name"];
$sql_creat = "create database " . $db_name;
if(mysql_list_dbs()){
if ($conn -> query($sql_creat) === TRUE) {
    echo "数据库创建成功";
}else {
	echo "数据库创建失败：" . $conn -> error ;
}}
$table_creat = "
	create $table_name $db_name (
		id int unsigned auto_increment primary key,
		link_name varchar not null
		link_addr varchar not null
	)";
if ($conn -> query($table_creat) === TRUE) {
	echo '表创建成功';
}else{
	echo '数据表创建失败' . $conn -> error ;
}
$conn ->close();

?>
